<#assign tit>上传会员照片</#assign>
<@page.html title=tit>
<script type="text/javascript" src="${_appPath!}/js/swfobject.js"></script>
<script type="text/javascript" src="${_appPath!}/js/avatarEditor.js"></script>
<script type="text/javascript">
  function doOk(data) {
    if(window.parent && window.parent.uploadOk)
      window.parent.uploadOk(data.data);
    cancel();
  }
  function cancel() {
    if(window.parent && window.parent.closeWin)
      window.parent.closeWin();
    else
      window.close();
  }
</script>
<div style="">
  <div id="div_swf"></div>
</div>
<script type="text/javascript">
  var swf = new avatarEditor("${_appPath!}/images/avatarEditor.swf", "div_swf", {
      id : 'swf',
      upload_url: '_upload',
      quality: 80,
      avatar_field_names: 'file',
      avatar_sizes: '160*160',
      avatar_scale: 3
    }, function (msg) {
      if(msg.code==5) {
        if(msg.type == 0) {
          doOk(msg.content);
        } else if(msg.type == 1) {
          window.alert(msg.content.msg);
        } else {
          window.alert(msg.type);
        }
      }
    }
  );
</script>
</@page.html>